package cn.edik.websocketdemo;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
//@RequestMapping("/")
public class IndexController {

    @Autowired
    private WebSocket webSocket;

    @GetMapping("/")
    public String index(){
        webSocket.sendMessage("第一个消息");
        return "index";
    }

}
